import { RequestImpl } from "../Impl.interface";
import {mock} from "./mock";
import { AxiosRequestConfig, AxiosResponse } from "axios";

export class Mock implements RequestImpl {
  get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R> {
    return mock.get(url, config) as Promise<R>;
  }
  post<T = any, R = AxiosResponse<T, any>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R> {
    return mock.post(url, data, config) as Promise<R>;
  }
  delete<T = any, R = AxiosResponse<T, any>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R> {
    return mock.delete(url, config) as Promise<R>;
  }
  put<T = any, R = AxiosResponse<T, any>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R> {
    return mock.put(url, data, config) as Promise<R>;
  }
}
